package cn.com.generaldata.os.paging;

import cn.com.generaldata.os.constant.FilterConstant;

public class FilterRule {

	private byte searchType;
	private String fieldName;
	private Object value;
	private String valueType;
	private Object value2;

	public FilterRule() {
	}

	public FilterRule(byte byte0, String s, Object obj) {
		searchType = byte0;
		fieldName = s;
		value = obj;
	}

	public FilterRule(byte byte0, String s, Object obj, Object obj2) {
		searchType = byte0;
		fieldName = s;
		value = obj;
		value2 = obj2;
	}

	// public FilterRule(byte byte0, String s, Object obj, String s1) {
	// searchType = byte0;
	// fieldName = s;
	// value = obj;
	// valueType = s1;
	// }

	public void setValueType(String s) {
		valueType = s;
	}

	public String getFieldName() {
		return fieldName;
	}

	public void setFieldName(String s) {
		fieldName = s;
	}

	public byte getSearchType() {
		return searchType;
	}

	public void setSearchType(byte byte0) {
		searchType = byte0;
	}

	public Object getValue() {
		return value;
	}

	public Object getValue2() {
		return value2;
	}

	public void setValue2(Object value2) {
		this.value2 = value2;
	}

	public void setValue(Object obj) {
		value = obj;
	}

	public Class<?> getValueTypeClass() {
		if (valueType == null) {
			return null;
		}
		if (valueType.equals(FilterConstant.VALUE_TYPE_STRING)) {
			return java.lang.String.class;
		}
		if (valueType.equals(FilterConstant.VALUE_TYPE_DATE)) {
			return java.util.Date.class;
		}
		if (valueType.equals(FilterConstant.VALUE_TYPE_SHORT)) {
			return java.lang.Short.class;
		}
		if (valueType.equals(FilterConstant.VALUE_TYPE_LONG)) {
			return java.lang.Long.class;
		}
		if (valueType.equals(FilterConstant.VALUE_TYPE_BYTE)) {
			return java.lang.Short.class;
		} else {
			return null;
		}
	}

	public String getValueType() {
		return valueType;
	}

}
